﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sherwood.SignOn.Server.Models.ViewModels.RegisterViewModel>" %>
<%@ Import Namespace="Sherwood.SignOn.Server.Models" %>
<%@ Import Namespace="Sherwood.Mvc.Html" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Translations.EditProfile_Title %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="register">
    <% using (Html.BeginForm()) {%>
            <script type="text/javascript">
                $(document).ready(function () {
                    $('#calDateOfBirth').datepicker({ buttonText: '...', changeMonth: true, changeYear: true, yearRange: '1890:<%= DateTime.Now.Year %>', showOn: 'button', dateFormat: 'yy-mm-dd' });
                    $('form').submit(function () {
                        $('#calDateOfBirth')[0].disabled = false;
                    });
                });   
    </script>

    <h2><%= Translations.EditProfile_Title %></h2>  
    <%= Translations.EditProfile_Intro_Text.Parameterize(Model) %>
    <%= Html.ValidationMessage("") %>
    <%= ViewData["ProfileSavedMessage"] %>
    <% Html.BeginForm(); %>
    <a class="link-button" href="/UserAccount/ForgotPassword/?UserName=<%= Model.UserName %>&Email=<%= Model.Email %>"><span class="icon-lock"></span><%= Translations.EditProfile_Reset_Password_Link %></a>
    <div class="spacer"></div>
    <div class="input-title">
    <%= Translations._Username %></div>
    <div class="input"><%= Html.TextBox("Username",Model.UserName, new { disabled = "true" })%>
    </div>
    <!--div class="input-title"><%= Translations._Password %></div>
    <div class="input"><%= Html.Password("Password")  %>
    <%= Html.ValidationMessage("Password")  %> <%= Translations.EditProfile_Password %>
    </div-->    
    <div class="input-title"><%= Translations._First_Name %></div>
    <div class="input"><%= Html.TextBox("FirstName")  %>
    <%= Html.ValidationMessage("FirstName")  %>
    </div>
    <div class="input-title"><%= Translations._Last_Name %></div>
    <div class="input"><%= Html.TextBox("LastName")  %>
    <%= Html.ValidationMessage("LastName")  %>
    </div>
    
    <div class="input-title">
    <%= Translations._Email %></div>
    <div class="input"><%= Html.TextBox("Email")  %>
    <%= Html.ValidationMessage("Email")  %> <%= Model.PendingEmailChangeText %>
    </div>
    <div class="input-title"><%= Translations._Cell_Phone %></div>
    <div class="input"><%= Html.TextBox("Mobile")  %>
    <%= Html.ValidationMessage("Mobile")  %>
    </div>
    <div class="input-title"><%= Translations._Date_Of_Birth %></div>
    <div class="input birth"><%= Html.TextBox("DateOfBirth", (Model.DateOfBirth.HasValue ? Model.DateOfBirth.GetValueOrDefault().ToString("yyyy-MM-dd") : null), new { id = "calDateOfBirth", disabled = "true" })%>
    <%= Html.ValidationMessage("DateOfBirth")  %>
    </div>
    <!--div class="input-title"><%= Translations._Gender %></div>
    <div class="input"><%= Html.DropDownList("Gender", EnumSelectList.GetList(typeof(Sherwood.SignOn.Gender), Convert.ToInt32(ViewData["Gender"]), false))%>
    <%= Html.ValidationMessage("Gender")  %>
    </div-->
    <div class="spacer"></div>
    <div class="input-title"><%= Translations._Country %></div>
    <div class="input"><%= Html.DropDownList("Country", CountrySelectList.GetList(ViewData["Country"],false))%>
    <%= Html.ValidationMessage("Country")  %>
    </div>
    <div class="input-title"><%= Translations.Register_Preferred_Language %></div>
    <div class="input"><%= Html.DropDownList("CultureName1", CultureSelectList.GetList(ViewData["CultureName1"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName1")  %>
    </div>
    <div class="input-title"><%= Translations.Register_Second_Language_Preference %></div>
    <div class="input"><%= Html.DropDownList("CultureName2", MediumCultureSelectList.GetList(ViewData["CultureName2"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName2")  %>
    </div>
    <div class="input-title"><%= Translations.Register_Third_Language_Preference %></div>
    <div class="input"><%= Html.DropDownList("CultureName3", ShortCultureSelectList.GetList(ViewData["CultureName3"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName3")  %>
    </div>
    <div class="spacer"></div>
    <div class="submit"><input type="submit" name="submit" id="submit" value="<%= Translations.EditProfile_Save_Button %>" /></div>
                
<br /><br /><br />
    <a class="link-support" href="/Support/" title="<%: Translations.SignIn_SupportLink %>"><img src="/Content/Help-32.png" alt="<%: Translations.SignIn_SupportLink %>" /><span><%: Translations.SignIn_SupportLink %></span></a>
    <br />
    <% Html.EndForm(); %>
    <%= Translations.EditProfile_Footer_Text.Parameterize(Model) %>
    <% } %>
</div>

</asp:Content>

